<template>
  <!-- 修改补充地址 -->
  <div class="return_addr_win">
    <el-dialog
      title="修改补充地址"
      :visible.sync="visible"
      :close-on-click-modal="false"
      width="400px"
      size="small"
      :before-close="onOk"
      @close="formData.supplementary_address = ''"
    >
      <div class="addr_win_top">
        <div class="addr_text1">{{formData.id}} {{formData.obj_name}}</div>
        <div class="addr_text2">{{formData.details}}</div>
        <div class="addr_text3">补充地址：</div>
        <el-input
          class="addr_inp4"
          placeholder="请输入补充地址"
          size="mini"
          type="text"
          style="width:300px;"
          v-model="formData.supplementary_address"
        ></el-input>
        <div class="addr_text5">源地址：{{formData.source_address}}</div>
      </div>
      <div class="addr_win_bottom">
        <el-button type="primary" size="mini" @click="sureClick">确定</el-button>
        <el-button size="mini" @click="onOk">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    visible: Boolean,
    onOk: Function,
    confirmSubmit: Function,
    editAddrFormData: Object,
  },
  data() {
    return {
      formData: {},
    };
  },
  watch: {
    editAddrFormData: function (val) {
      this.formData = val;
    },
  },
  mounted() {
    // this.formData = JSON.parse(JSON.stringify(this.editAddrFormData));
  },
  methods: {
    sureClick() {
      // console.log('this.confirmSubmit()');
      this.confirmSubmit(this.formData);
    },
  },
};
</script>

<style lang="less">
.return_addr_win .el-dialog__body {
  padding-top: 10px;
}

.return_addr_win .el-dialog__body .el-form-item__label {
  font-size: 12px;
}

.return_addr_win .el-dialog__body .el-form-item {
  margin-bottom: 0px;
}
.return_addr_win .el-dialog__body .el-form-item .el-input input {
  padding-left: 5px;
}

.return_addr_win .el-dialog__body .el-form-item__label {
  font-size: 12px;
}

.return_addr_win .el-dialog__header {
  border-bottom: #ececec 1px solid;
  padding: 10px 20px;
}
.return_addr_win .el-dialog__title {
  font-size: 14px;
  font-weight: 600;
}

.addr_win_top {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 30px;
  font-size: 12px;
  .addr_text1 {
    font-weight: 600;
  }
  .addr_text2 {
    color: #999;
    margin-top: 5px;
  }
  .addr_text3 {
    font-weight: 600;
    margin-top: 20px;
  }
  .addr_inp4 input {
    border: 1px solid #dcdfe6;
    margin-top: 5px;
  }
  .addr_text5 {
    margin-top: 5px;
    color: #999;
  }
}
.addr_win_bottom {
  text-align: center;
  margin-top: 60px;
  // & > .el-button:nth-child(1){

  // }
}
</style>